<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var num = parseInt(prompt("请输入三位整数"))
    var num1 = ( num - num% 100 ) / 100 ; 
    var num2 = ( num % 100 - num % 10 ) / 10;
    var num3 = num % 10; 
    var result = num1 + num2 + num3; 
    alert(result); 
</script>
</html>